<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<a href="123" > 百度一下</a>
<script type="text/javascript">
	let a = document.getElementsByTagName('a')[0]
	//读取属性getAttribute("属性名") 返回的是字符串
	console.log(a.getAttribute("href"))//123

	//写入属性setAttribute("属性名","属性值")
	a.setAttribute("title","鼠标放上去了")
</script>
</body>
</html>